import request from "@/utils/request";
/******* 事件*****/
// 获取分页列表
export function getEventPageList(params) {
  return request({
    // baseURL: '/dev-api',
    url: "/evt",
    method: "get",
    params,
  });
}
// 详情
export function getEventDetail(id) {
  return request({
    // baseURL: '/dev-api',
    url: `/evt/${id}`,
    method: "get",
  });
}
// 新增
export function createEvent(data) {
  return request({
    // baseURL: '/dev-api',
    url: "/evt",
    method: "post",
    data,
  });
}
// 修改
export function updateEvent(data) {
  return request({
    //    baseURL: '/dev-api',
    url: `/evt/${data.id}`,
    method: "put",
    data,
  });
}

// 删除
export function deleteEvent(id) {
  return request({
    // baseURL: '/dev-api',
    url: `/evt/${id}`,
    method: "delete",
  });
}

// 上下线
export function onlineEvent(id, sts) {
  return request({
    // baseURL: '/dev-api',
    url: `/evt/${id}/sts/${sts}`,
    method: "put",
  });
}
// 事件对账列表
export function getEventAccountList(params) {
  return request({
    url: "bc-logger/evt/callback/log/account/list",
    method: "get",
    params,
  });
}
// 重新推送
export function retryPush(logId) {
  return request({
    url: `bc-logger/evt/callback/log/account/${logId}/retry`,
    method: "post",
  });
}

// 事件对账详情
export function getEventAccountDetail(logId) {
  return request({
    url: `bc-logger/evt/callback/log/account/${logId}/info`,
    method: "post",
  });
}
// 事件日志
export function getEventLog(params) {
  return request({
    url: `/bc-logger/evt/log/list`,
    method: "get",
    params
  });
}

// 根据事件查询订阅应用列表
export function getEvtPerms(params){
  return request({
    url: `/app/list/evt/perms`,
    method: "get",
    params
  });
}
